package com.gang.mars.aop.service.impl;

import com.gang.mars.aop.annotation.CustomizeAnnotation;
import com.gang.mars.aop.enums.PersonEnum;
import com.gang.mars.aop.service.HelloWorldService;
import org.springframework.stereotype.Component;

/**
 * @author gang.chen
 * @since  2020/12/18 14:36
 */
@Component
public class HelloWorldServiceImpl implements HelloWorldService {

    @Override
    public void say() {
        System.out.println("HelloWorldServiceImpl -> say() hello world");
    }

    @Override
    public void hit() {
        System.out.println("HelloWorldServiceImpl -> hit() hit world");
    }



    @Override
    @CustomizeAnnotation(name = "#name",personEnum = PersonEnum.FEMALE)
    public void say(String name, PersonEnum personEnum) {
        System.out.println(name);
        System.out.println(personEnum);
    }


    @Override
    public void test1() {
        System.out.println("test1...");
    }
    @Override
    public void test2() {
        System.out.println("test2...");
    }

    @Override
    public void test3() {
        System.out.println("test3...");
    }

    @Override
    public void test4() {
        System.out.println("test4");
        throw new NullPointerException();
    }

    @Override
    public void test5() {
        System.out.println("test5...");
    }


}
